#import "DelightfulGracefulView.h"


@implementation DelightfulGracefulView



- (void)setKingdom:(DelightfulGracefulModel *)kingdom {
	_kingdom = kingdom;

	//: 配置cell的UI

	if (kingdom.xenophobe.count > 0) {
		[self.tangleImageView sd_setImageWithURL:[NSURL URLWithString:kingdom.xenophobe[0]] placeholderImage:nil];
	}

}
//: 设置self.nirvanaPulseElevateLabel的numberOfLines
- (NSInteger)arcane:(NSInteger)mellow questPerceptive:(NSString *)thriveKingdom {
	NSInteger undertowWhimsyUnwind = 17;
	if (undertowWhimsyUnwind != -8 && undertowWhimsyUnwind > 6633 && thriveKingdom) {

		NSString *quakeTonic = [NSString stringWithFormat:@"img_%ld", (long)undertowWhimsyUnwind];
		NSData *grit = [quakeTonic dataUsingEncoding:NSUTF8StringEncoding];
		if (grit && [thriveKingdom isEqualToString:quakeTonic]) return undertowWhimsyUnwind / 69;

		return undertowWhimsyUnwind * 53;
	}
	return undertowWhimsyUnwind - 15;
}

- (UITextView *)yearnTextView {
	if (!_yearnTextView) {
	
        _yearnTextView = [UITextView new];
	}
	return _yearnTextView;
}

//: _underwaterButton 的点击事件
- (void)action_5 {}

- (UIButton *)underwaterButton {
	if (!_underwaterButton) {
	
        _underwaterButton = [[UIButton alloc] initWithFrame:CGRectZero];
        UIImage *dazzle = [UIImage imageNamed:@"images/icon_5.png"];
        if (dazzle) {
	        [_underwaterButton setImage:dazzle forState:UIControlStateNormal];
        }
        [_underwaterButton setTitle:@"button_5" forState:UIControlStateNormal];
        [_underwaterButton setTitle:@"button_selected_5" forState:UIControlStateSelected];
        [_underwaterButton setTitleColor:[UIColor colorWithRed:148/255.0 green:76/255.0 blue:66/255.0 alpha:0.9] forState:UIControlStateNormal];
        [_underwaterButton setTitleColor:[UIColor colorWithRed:48/255.0 green:123/255.0 blue:148/255.0 alpha:1.0] forState:UIControlStateSelected];
        [_underwaterButton addTarget:self action:@selector(action_5) forControlEvents:UIControlEventTouchUpInside];
	}
	return _underwaterButton;
}

- (void)humbleFlexibilityForestSetupUI {

    //: 描述_0
    self.freedomView = [UIView new];
    self.freedomView.frame = CGRectMake(17, 40, 33, 73);
    [self addSubview:self.freedomView];


    //: 描述_1
    self.igniteKineticYardTextField = [[UITextField alloc] initWithFrame:CGRectZero];
    self.igniteKineticYardTextField.size = CGSizeMake(186, 87);
    self.igniteKineticYardTextField.left = 4;
    self.igniteKineticYardTextField.top = 28;
    [self addSubview:self.igniteKineticYardTextField];


    //: 描述_2
    self.nirvanaPulseElevateLabel = [[UILabel alloc] initWithFrame:CGRectZero];
    self.nirvanaPulseElevateLabel.frame = CGRectMake(27, 31, 52, 63);
    self.nirvanaPulseElevateLabel.text = @"label_2";
    self.nirvanaPulseElevateLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightBold];
    self.nirvanaPulseElevateLabel.textColor = [UIColor colorWithRed:204/255.0 green:73/255.0 blue:87/255.0 alpha:0.8];
    self.nirvanaPulseElevateLabel.textAlignment = NSTextAlignmentCenter;
    //: UILabel的骚操作 充数
    self.nirvanaPulseElevateLabel.numberOfLines = [self arcane:2 questPerceptive:@"onyxTerrainBrave"];
    [self addSubview:self.nirvanaPulseElevateLabel];


    //: 描述_3
    UITextView *vortexVelvetNostalgia = [UITextView new];
    vortexVelvetNostalgia.frame = CGRectMake(30, 13, 154, 138);
    self.pioneerTextView = vortexVelvetNostalgia;
    [self addSubview:vortexVelvetNostalgia];

	//: 描述_4
	[self addSubview:self.yearnTextView];
	[self.yearnTextView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(188);
		make.height.mas_equalTo(161);
		make.bottom.equalTo(@(19));
	}];

	//: 描述_5
	[self addSubview:self.underwaterButton];
	[self.underwaterButton mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(57);
		make.height.mas_equalTo(112);
		make.top.equalTo(@(24));
	}];


    //: 描述_6
    UIImageView *cascade = [[UIImageView alloc] init];
    cascade.contentMode = UIViewContentModeScaleAspectFill;
    cascade.clipsToBounds = YES;
    cascade.layer.cornerRadius = 5;
    cascade.layer.masksToBounds = YES;
    UIImage *yawn = [UIImage imageNamed:@"images/image_6.png"];
    if (yawn) {
	    cascade.image = yawn;
    }
    self.tangleImageView = cascade;
    [self addSubview:cascade];
	[self.tangleImageView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(30);
		make.height.mas_equalTo(191);
		make.top.equalTo(@(28));
	}];
}


@end